From b883fe3b723bb417869063bee77d173640c8879a Mon Sep 17 00:00:00 2001 From: robertlipe Date: Mon, 17 Feb 2014 20:36:17 +0000 Subject: [PATCH] Yet more -Wall chatter from Ubuntu. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4750 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/exif.cc | 8 ++++---- gpsbabel/gopal.cc | 5 +---- gpsbabel/magproto.cc | 6 ++---- gpsbabel/mapsource.cc | 2 +- gpsbabel/pcx.cc | 2 +- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/gpsbabel/exif.cc b/gpsbabel/exif.cc index 56875e88e..fbb473131 100644 --- a/gpsbabel/exif.cc +++ b/gpsbabel/exif.cc @@ -452,9 +452,12 @@ exif_read_ifd(exif_app_t* app, const uint16_t ifd_nr, gbsize_t offs, for (i = 0; i < ifd->count; i++) { exif_tag_t* tag; - offs = gbftell(fin); tag = (exif_tag_t*) xcalloc(sizeof(*tag), 1); +#ifdef EXIF_DBG + tag->offs = offs; + offs = gbftell(fin); +#endif ENQUEUE_TAIL(&ifd->tags, &tag->Q); @@ -463,9 +466,6 @@ exif_read_ifd(exif_app_t* app, const uint16_t ifd_nr, gbsize_t offs, tag->count = gbfgetuint32(fin); tag->size = exif_type_size(tag->type) * tag->count; tag->data = &tag->value; -#ifdef EXIF_DBG - tag->offs = offs; -#endif if (BYTE_TYPE(tag->type) && (tag->count <= 4)) { gbfread(tag->data, 4, 1, fin); diff --git a/gpsbabel/gopal.cc b/gpsbabel/gopal.cc index 0d42558c4..e8ce026e0 100644 --- a/gpsbabel/gopal.cc +++ b/gpsbabel/gopal.cc @@ -176,10 +176,9 @@ gopal_read(void) int fix, hms; route_head* route; Waypoint* wpt, *lastwpt=NULL; - double long_old,lat_old; + double lat_old; char tbuffer[64]; struct tm tm2; - long_old=0; lat_old=0; strftime(routename,sizeof(routename),"Tracklog %c",gmtime(&tx)); @@ -306,7 +305,6 @@ gopal_read(void) if ((wpt->fix != fix_none)&&(lat_old==0)) { //first-time init lat_old=wpt->latitude; - long_old=wpt->longitude; //route_add_wpt(route, wpt); lastwpt=wpt; } @@ -330,7 +328,6 @@ gopal_read(void) fprintf(stderr,"valid line %5lu: \"%s\" %lf km/h\n",line,buff,speed); } lastwpt=wpt; - long_old=wpt->longitude; lat_old=wpt->latitude; route_add_wpt(route,wpt); waypt_add(new Waypoint(*wpt)); diff --git a/gpsbabel/magproto.cc b/gpsbabel/magproto.cc index 103c6eba1..32bfc27d9 100644 --- a/gpsbabel/magproto.cc +++ b/gpsbabel/magproto.cc @@ -340,7 +340,7 @@ mag_writeack(int osum) return; } - i = sprintf(nbuf, "PMGNCSM,%02X", osum); + (void) sprintf(nbuf, "PMGNCSM,%02X", osum); nsum = mag_checksum(nbuf); i = sprintf(obuf, "$%s*%02X\r\n",nbuf, nsum); @@ -1176,13 +1176,11 @@ mag_rteparse(char* rtemsg) QString mag_find_descr_from_token(const char* token) { - icon_mapping_t* i = icon_mapping; - if (icon_mapping == NULL) { return "unknown"; } - for (i = icon_mapping; i->token; i++) { + for (icon_mapping_t* i = icon_mapping; i->token; i++) { if (token[0] == 0) { break; } diff --git a/gpsbabel/mapsource.cc b/gpsbabel/mapsource.cc index e2bfb9916..f052790cb 100644 --- a/gpsbabel/mapsource.cc +++ b/gpsbabel/mapsource.cc @@ -1830,7 +1830,7 @@ mps_write(void) route_head* rte; route_head* trk; - char recType; + char recType = -1; int reclen; /* TODO: This kills a compiler warning but I'm not sure it's right */ int reclen2 = 0; diff --git a/gpsbabel/pcx.cc b/gpsbabel/pcx.cc index 9152b43cc..a2cdb7cd1 100644 --- a/gpsbabel/pcx.cc +++ b/gpsbabel/pcx.cc @@ -291,7 +291,7 @@ data_read(void) char* i = ibuf; sym_col = 0; - for (col = 0, i = ibuf; *i; col++, i++) { + for (col = 0; *i; col++, i++) { if (0 == case_ignore_strncmp(i, "comment", 7)) { comment_col = col; } -- 2.30.2